package com.shenhan;

import com.shenhan.job.HelloJob;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

/**
 * @author shenhan
 * @create 2020/2/10 14:41
 * @description
 */
public class TestCron {
    public static void main(String[] args) throws SchedulerException {
        final Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
        final JobDetail jobDetail = JobBuilder.newJob(HelloJob.class)
                .withIdentity("jobCron", "group1").build();
        final CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity("cronTrigger", "triggerGroup")
                .startNow()
                .withSchedule(CronScheduleBuilder.cronSchedule("0 13 15 ? * *")).build();
        scheduler.scheduleJob(jobDetail, trigger);
        scheduler.start();
        /**
         * 测试上传dev分支
         */
    }
}
